package com.sq.partner.manager.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.sq.partner.manager.dao.ITradNoticeMtDao;
import com.sq.partner.manager.dao.ITradNoticePartnerMtDao;
import com.sq.partner.manager.mybatis.model.GatewayUser;
import com.sq.partner.manager.mybatis.model.TradNotice;
import com.sq.partner.manager.mybatis.model.TradNoticePartner;
import com.sq.partner.manager.service.ITradNoticeService;
import com.sq.partner.manager.util.Page;

@Service
public class ITradNoticeServiceImpl implements ITradNoticeService {
	@Resource
	private ITradNoticeMtDao tradNoticeMtDao;
	@Resource
	private ITradNoticePartnerMtDao tradNoticePartnerMtDao;

	@Override
	public Page<TradNotice> queryInfoByCriteria(Page<TradNotice> page,
			GatewayUser user) throws Exception {
		return tradNoticeMtDao.queryInfoByCriteria(page, user);
	}
	@Override
	public TradNotice queryInfoByTradNoticeId(String Id) throws Exception {
		return tradNoticeMtDao.queryInfoByTradNoticeId(Id);
	}
	@Override
	public List<TradNoticePartner> queryTreeDtoByPriBranchCode(String deptCodeStr) throws Exception {
		return tradNoticePartnerMtDao.queryTreeDtoByPriBranchCode(deptCodeStr);
	}
	@Override
	public List<TradNoticePartner> queryRelationInfoByNoticeId(String noticeId)	throws Exception {
		return tradNoticePartnerMtDao.queryRelationInfoByNoticeId(noticeId);
	}
	@Override
	public boolean delTradNoticeById(String Id) throws Exception {
		return tradNoticeMtDao.delTradNoticeById(Id);
	}
	@Override
	public boolean delTradNoticePartnerById(String Id) throws Exception {
		return tradNoticePartnerMtDao.delTradNoticePartnerInfo(Id);
	}
	@Override
	public String addTradNoticeInfo(TradNotice tradNotice) throws Exception {
		return tradNoticeMtDao.addTradNoticeInfo(tradNotice);
	}
	@Override
	public boolean addTradNoticePartnerInfo(List<TradNoticePartner> ls) throws Exception {
		return tradNoticePartnerMtDao.addTradNoticePartnerInfo(ls);
	}
	
}
